package panda.query.condition;

import panda.query.scan.Scanner;
import panda.query.struct.Attribute;
import panda.query.struct.Constant;
import panda.record.Schema;
import panda.transaction.Transaction;

public interface ValueExpression {
	
	/**
	 * 
	 * @param s 
	 * @return
	 */
	public Constant evaluate(Scanner s, Transaction tx);
	
	/**
	 * 
	 * @param attr
	 * @return
	 */
	public boolean dominates(Attribute attr);
	
	/**
	 * 
	 * @return
	 */
	public boolean isConstant();
	
	/**
	 * Return the result of the constant expression
	 * @return The result of the expression
	 */
	public Constant asConstant();
	
	/**
	 * Check whether this expression applies to <i>SELECT</i> 
	 * in the specified schema
	 * @param sch the given schema
	 * @return result
	 */
	public boolean appliesTo(Schema sch);
	
	
}
